﻿	

#region Using Directives
using System;
using System.ComponentModel;
using System.Collections;
using System.Xml.Serialization;
using System.Data;
using System.Collections.Generic;
using System.Linq;

using BesAsm.ModelData.Entities;
using BesAsm.ModelData.Data;
using Microsoft.Practices.EnterpriseLibrary.Logging;
using BesAsm.MasterData.Entities;
using BesAsm.MasterData.Entities.Validation;
using BesAsm.MasterData.Services;

#endregion

namespace BesAsm.ModelData.Services
{		
	/// <summary>
	/// An component type implementation of the 'MODEL_STREET_TARGETS' table.
	/// </summary>
	/// <remarks>
	/// All custom implementations should be done here.
	/// </remarks>
	[CLSCompliant(true)]
	public partial class ModelStreetTargetService : BesAsm.ModelData.Services.ModelStreetTargetServiceBase, IArcEntityService<ModelStreetTarget>
	{
		#region Constructors
		/// <summary>
		/// Initializes a new instance of the ModelStreetTargetService class.
		/// </summary>
		public ModelStreetTargetService() : base()
		{
		}
		#endregion Constructors


    #region IArcEntityService<ModelStreetTarget> Members

    /// <summary>
    /// Gets an IArcEntity from the default service provider using the ArcGIS Object ID
    /// </summary>
    /// <param name="objectId">The Object ID of the entity to return</param>
    /// <returns>The IArcEntity with a matching Object ID</returns>
    public IArcEntity Get(int objectId)
    {
      return (IArcEntity)base.GetByObjectid(objectId);
    }

    /// <summary>
    /// Gets a TList of Link objects that match the provided ObjectId array
    /// </summary>
    /// <param name="oids">The ObjectId array to retrieve</param>
    /// <returns>A TList of Link objects</returns>
    public TList<ModelStreetTarget> GetByOids(IEnumerable<int> oids)
    {
      List<int> oidList = oids.ToList();

      TList<ModelStreetTarget> returnList = new TList<ModelStreetTarget>();

      DataTable dt = new DataTable("id_table");
      dt.Columns.Add(new DataColumn("oid", typeof(Int32)));

      foreach (int oid in oids)
        dt.Rows.Add(oid);

      return this.SelectByOids(dt);
    }

    /// <summary>
    /// Gets the name of the ObjectId field.
    /// </summary>
    public string OidField { get { return "ObjectId"; } }

    #endregion
  }//End Class

} // end namespace
